<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OOJS</title>
    <link rel="stylesheet" href="../css/common.css" />
    <script src="../js/js03_oojs_03.js" async></script>
</head>
<body>
    <h1>OOJS——继承</h1>
    <p class="msg"></p>
    <script>
        document.addEventListener("DOMContentLoaded", function(){
            let msg = document.querySelector(".msg");

            let person = new Person("张三");
            msg.innerHTML += person.sayHello();
            msg.innerHTML += "<br>";

            let teacher = new Teacher("李四","软件工程");
            msg.innerHTML += teacher.sayHello();      
            msg.innerHTML += "<br>";
            
            msg.innerHTML += teacher.walk();

            console.log(teacher.__proto__);
            console.log(teacher.__proto__ === Teacher.prototype);
            console.log(teacher.__proto__.constructor);
            console.log(teacher.__proto__.__proto__.walk);
            console.log(teacher.__proto__.__proto__.constructor);
            console.log(teacher.__proto__.__proto__.__proto__.constructor);
            console.log(Teacher.prototype.__proto__.sayHello);          
        })
    </script>    
</body>
</html>